<form id="EditGuid" method="post" novalidate="novalidate" class="form-inline">
	<div class="row">
		<div class="col-lg-12 col-md-12">
			<div class="form-group">
				<label>城市 :</label>
				<input class="form-control" id="cityName" type="text" name="cityName" placeholder="城市" style="width: 160px;" />
			</div>
		</div>
		<div class="col-lg-12 col-md-12">
			<div class="form-group">
				<label>区县 :</label>
				<select class="form-control" id="areaname" name="countryName" onchange="changearea()" style="width: 160px;">
					<option value="">区/县</option>
				</select>
			</div>
		</div>
		<div class="col-lg-12 col-md-12">
			<div class="form-group">
				<label>分局 :</label>
				<select class="form-control" id="branchOfficeId" name="branchOffice"  style="width: 160px;">
					<option value="">分局</option>
				</select>
			</div>
		</div>
		<div class="col-lg-12 col-md-12">
			<div class="form-group">
				<label>名称 :</label>
				<input class="form-control" id="guidName" type="text" name="gridName" placeholder="名称" style="width: 160px;" />
			</div>
		</div>
		<div class="col-lg-12 col-md-12">
			<div class="form-group">
				<label>排查 :</label>
				<select class="form-control" id="status" name="status"  style="width: 160px;">
					<option value="0" selected="selected">未排查</option>
					<option value="1">已排查</option>
				</select>
			</div>
		</div>
		<input type="hidden" id="id" name="id">
	</div>
</form>
<script>
	$(function() {
		GetArea();
	})
	//获取区县
	function GetArea() {
		var json = {
			url: GLOBAL.URL + "/guidinfo/getAllAreaList",
			type: 'post',
			data: {
				"queryType": 0
			},
			successfn: function(data) {
				SetArea(data);
			},
			errorfn: function() {
				//ajaxUpdataTable();
				//$.ligerDialog.warn("系统繁忙，请稍候再试");
			}
		};
		ajaxdata(json);
	}

	function SetArea(data) {
		var str = '<option value="">区/县</option>';
		for(var i = 0; i < data.data.length; i++) {
			str += '<option value="' + data.data[i].area + '">' + data.data[i].area + '</option>';
		}
		$("#areaname").html(str);
	}
	//区县点击
	function changearea() {
		if($("#areaname").val() == "") {
			$("#branchOfficeId").html('<option value="">分局</option>');
			$("#gridId").html('<option value="">网格</option>');
		} else {
			GetWork($("#areaname").val());
		}
	}
	//获取分局
	function GetWork(areaname) {
		var json = {
			url: GLOBAL.URL + "/guidinfo/getAllAreaList",
			type: 'post',
			data: {
				"area": areaname,
				"queryType": 1
			},
			successfn: function(data) {
				SetWork(data);
			},
			errorfn: function() {
				//ajaxUpdataTable();
				//$.ligerDialog.warn("系统繁忙，请稍候再试");
			}
		};
		ajaxdata(json);
	}
	function SetWork(data) {
		var str = '<option value="">分局</option>';
		for(var i = 0; i < data.data.length; i++) {
			str += '<option value="' + data.data[i].town + '">' + data.data[i].town + '</option>';
		}
		$("#branchOfficeId").html(str);
	}
</script>